//
// Created by fairy on 2025/3/30 18:12.
//
#ifndef ZQ_INTERRUPT_H
#define ZQ_INTERRUPT_H
#include<zq_conf.h>
#include<zq_cpu.h>

namespace zq
{
    class ISR
    {
    public:
        static void init()
        {
#if !defined(__ARM__)
            asm(" BSET INTM"); // BSET也就是置1，即禁止所有可屏蔽中断
#endif
            cpu::IVPD::write(0x02);
            cpu::IVPH::write(0x02);
            cpu::IFR0::write(0xffff); // 清除所有中断标志位
            cpu::IFR1::write(0xffff); // 清除所有中断标志位
#if !defined(__ARM__)
            asm(" BCLR INTM"); // 允许所有可屏蔽中断
#endif
        }

        static void timer1();

        static void mcbsp0_receive();

        static void mcbsp0_transmit();

        static void dmac0();

        static void dmac1();

        static void dmac2();

        static void dmac3();

        static void dmac4();

        static void dmac5();
    };
}

#endif //ZQ_INTERRUPT_H
